package com.gitee.sop.layui.adminserver.module.base.bo;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 *
 * @author: huwei
 * @date:   2019/11/13 17:10
 * @version:  1.0.0
*/
@Data
@Accessors(chain = true)
public class ZTreeNode {

    /**
     * 节点id
     */
    private Integer id;

    /**
     * 父节点id
     */
    private Integer pId;

    /**
     * 节点名称
     */
    private String name;

    /**
     * 是否打开节点
     */
    private Boolean open;

    /**
     * 是否被选中
     */
    private Boolean checked;

    /**
     * 节点图标  single or group
     */
    private String iconSkin;

    /**
     * 创建ztree的父级节点
     *
     * @author fengshuonan
     * @Date 2018/12/23 4:51 PM
     */
    public static ZTreeNode createParent() {
        ZTreeNode zTreeNode = new ZTreeNode();
        zTreeNode.setChecked(true);
        zTreeNode.setId(0);
        zTreeNode.setName("顶级");
        zTreeNode.setOpen(true);
        zTreeNode.setPId(0);
        return zTreeNode;
    }

    public ZTreeNode() {
    }

    public ZTreeNode(Integer id, Integer pId, String name, Boolean open) {
        this.id = id;
        this.pId = pId;
        this.name = name;
        this.open = open;
    }
}
